package android.activities;

import android.app.Activity;
import android.os.Bundle;
import android.text.ClipboardManager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;

public class PasswordActivity extends Activity implements OnClickListener{

	EditText text1, text2, text3;
	int position = 0;
	
	public void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
        setContentView(R.layout.password);
        position = (int)BaseActivity._item;
        View button14 = findViewById(R.id.button14);
        button14.setOnClickListener(this);
        View button12 = findViewById(R.id.button12);
        button12.setOnClickListener(this);
        text1 = (EditText)findViewById(R.id.editText9);
        text2 = (EditText)findViewById(R.id.editText10);
        text3 = (EditText)findViewById(R.id.editText20);
        String login = BaseActivity.base.getName(position);
        String pass = BaseActivity.base.getPassword(position);
        String info = BaseActivity.base.getNote(position);
        text1.setText(login);
        text2.setText(pass);
        text3.setText(info);
    }
	
	public void onClick(View v) {
		switch(v.getId()) {
    	case R.id.button14:
    		finish();
    		break;    	
    	case R.id.button12:
    		ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
    		EditText editText10 = (EditText) findViewById(R.id.editText10);
            manager.setText(editText10.getText());
    		break;	
    	}		
	}

}
